﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using PH.Model.Standards;
namespace PH.Data.Standards
{
    public class EHAWCommand
    {
        //public static EHAWCollection Gets(EvaluationQuery sea)
        //{
        //    var ret = new EHAWCollection();
        //    using (DBCentre db = new DBCentre())
        //    {
        //        IQueryable<EHAW> q = db.DataContext.EHAWs;
        //        if (sea != null)
        //        {
        //            if (sea.GradeCode > 0)
        //                q = q.Where(p => p.GradeCode == sea.GradeCode);
        //            if (sea.Sex > 0)
        //                q = q.Where(p => p.Sex == sea.Sex);
        //        }
        //        var n = q.Count();
        //        if (n > 0)
        //        {
        //            q = q.OrderBy(p => p.GradeCode).ThenBy(p => p.Sex).ThenBy(p => p.HeightMin);
        //            if (sea != null && sea.PageSize > 0)
        //                q = q.Skip(sea.PageSize * sea.PageIndex).Take(sea.PageSize);
        //            var lst = q.ToList();
        //            ret = Convertor.ConvertCollection<EHAWModel, EHAW, EHAWCollection>(lst);
        //            ret.TotalRecordsCount = n;
        //        }
        //    }
        //    return ret;
        //}
    }
}
